package edu.cuny.baruch.cis9590.library.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="books")
public final class Book {
    
    private String author;
    private String callNumber;
    private int id;
    private char status;
    private String title;
    
    public Book() {
    }
    
    public Book(String author, String callNumber, char status, String title) {
        this.author = author;
        this.callNumber = callNumber;
        this.status = status;
        this.title = title;
    }
    
    @Column(name="author")
    public String getAuthor() {
        return author;
    }
    
    @Column(name="call_number")
    public String getCallNumber() {
        return callNumber;
    }
    
    @Id
    @Column(name="book_id")
    @GeneratedValue(generator="increment")
    @GenericGenerator(name="increment", strategy="increment")
    public int getId() {
        return id;
    }
    
    @Column(name="status")
    public char getStatus() {
        return status;
    }
    
    @Column(name="title")
    public String getTitle() {
        return title;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void setCallNumber(String callNumber) {
        this.callNumber = callNumber;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setStatus(char status) {
        this.status = status;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    
    @Override
    public String toString() {
        return title;
    }
}
